﻿<%@ WebHandler Language="C#" Class="wxMiniProgramLogin" %>
using Models;
using System;
using System.Web;
using Newtonsoft.Json;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Net;
using Newtonsoft.Json.Linq;


public class wxMiniProgramLogin : IHttpHandler {
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";

        string postdata=Utils.PostInput(context);

        string authHeader = context.Request.Headers["token"];//Header中的token
        if (string.IsNullOrEmpty(authHeader))
        {
            HttpContext.Current.Response.Write("parameter error");
            return;
        }

        //goods_list: [{goods_id: 2, goods_num: 1, sku_price_id: 2, goods_price: "12.5"}]

        var data = new
        {
            data =  new
            { gid="1"},
            code = 1,
            msg = "获得购物车",
            time = DateTime.Now
        };
        Formatting microsoftDataFormatSettings = default(Formatting);
        string result = JsonConvert.SerializeObject(data, microsoftDataFormatSettings);

        context.Response.Write(result);



        HttpContext.Current.Response.End();
        //context.Response.Write("Hello World");


    }





    public bool IsReusable {
        get {
            return false;
        }
    }

}